home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 017a / binutils.arj / LIBCONVE < prev    next >
Text File  |  1991-03-27  |  867b  |  47 lines

  1. #! /bin/sh
  2.  
  3. if [ $# != 2 ]
  4. then
  5.     echo 'usage: libconvert from.a to.a'
  6.     exit 1
  7. fi
  8.  
  9. fromlib=$1
  10. tolib=$2
  11.  
  12. #
  13. # Convert coff libc to a coff-encapsulated libc
  14. # suitable for linking with the GNU linker.
  15. #
  16. # Extract all members of /lib/libc.a (using coff ar).
  17. # Convert each using robotussin.
  18. # Create new libc (using gnu ar) with members in the same order as coff libc.
  19.  
  20. # set -e makes this script exit if any command gets an error
  21. set -e
  22.  
  23. case $fromlib in 
  24. /*)     rel_fromlib=$fromlib ;;
  25. *)     rel_fromlib=../$fromlib ;;
  26. esac
  27.  
  28. case $tolib in
  29. /*)    rel_tolib=$tolib ;;
  30. *)    rel_tolib=../$tolib ;;
  31. esac
  32.  
  33. rm -rf libconvert-tmp
  34. mkdir libconvert-tmp
  35. cd libconvert-tmp 
  36. /bin/ar x $rel_fromlib
  37. for i in *
  38. do
  39.     echo $i
  40.     ../robotussin $i x
  41.     mv x $i
  42. done
  43. rm -f $rel_tolib
  44. ../ar rs $rel_tolib `/bin/ar t $rel_fromlib`
  45. cd ..
  46. rm -rf libconvert-tmp
  47.